<?php
include "conn.php";
$pagesize = 20;
$sql = "select * from goods where goods_id < 928 ";
$result = $conn->query($sql);
$num = $result->num_rows;
// echo $num;
$pagenum = ceil($num / $pagesize);
// echo $pagenum;
if (isset($_GET['page'])) {
    $pagevalue = $_GET['page'];
} else {
    $pagevalue = 1;
}
$page = ($pagevalue - 1) * $pagesize;
$sql1 = "select * from goods  limit $page,$pagesize";
$res = $conn->query($sql1);
$arr = array();
for ($i = 0; $i < $res->num_rows; $i++) {
    $arr[$i] = $res->fetch_assoc();
}
echo json_encode($arr);